package com.oi.test01.hw.tiMu09;

import java.util.HashMap;
import java.util.Map;
/**
 * @author bin
 * @date 2025 - 03 -19
 **/
public class JiaStringBuffer {
    public static String append(String sql, Map<String,Object> map) {
        StringBuffer stringBuffer = new StringBuffer(sql);
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            stringBuffer.append(" and "+entry.getKey()+" = " + "?");
        }
        return stringBuffer.toString();
    }

    public static void main(String[] args) {
        Map<String,Object> map = new HashMap<>();
        map.put("name","徐文斌");
        append("select * from user",map);
    }
}
